package com.example.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {
    @Value("${mytest}")
    private String mytest;

    @Value("${mytest2}")
    private String mytest2;

    @RequestMapping("/hi")
    public String sayHi(String name){
        if(!StringUtils.hasLength(name)){
            name="张三";
        }
        return "你好"+name;
    }
    @RequestMapping("/getconf")
    public String getconfig(){
        return mytest+ "  "+mytest2;
    }

}
